﻿using System;
using System.Windows.Data;

namespace XmlStudio.Utilities {
    /// <summary>
    /// Selected language converter.
    /// </summary>
    public class SelectedLangConverter : IValueConverter {
        #region IValueConverter Members

        /// <summary>
        /// Returns true if value == parameter, otherwise returns false.
        /// </summary>
        /// <param name="value">value to convert</param>
        /// <param name="targetType">target type</param>
        /// <param name="parameter">conversion parameter</param>
        /// <param name="culture">CultureInfo</param>
        /// <returns>True if value == parameter, false otherwise.</returns>
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
            //if (LanguageContext.Instance.Culture.Name == value as String) {
            if(value as String == parameter as String) {
                return true;
            } else {
                return false;
            }
        }

        /// <summary>
        /// Returns null.
        /// </summary>
        /// <param name="value"></param>
        /// <param name="targetType"></param>
        /// <param name="parameter"></param>
        /// <param name="culture"></param>
        /// <returns>null.</returns>
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
            return null;
        }

        #endregion
    }
}
